package com.seata.cloud.controller;

import com.seata.cloud.entity.Order;
import com.seata.cloud.response.Result;
import com.seata.cloud.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author wangyabin
 * @date 2021/11/26 10:31
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    
    @Autowired
    private OrderService orderService;

    /**
     * 创建订单
     */
    @PostMapping("/create")
    public Result create(@RequestBody Order order) {
        orderService.create(order);
        return Result.success("订单创建成功!", 200);
    }
}
